<template>
  <div>
  <!-- 模糊查 -->
    <div>
        <div style="height:30px ;width: 100%;background:#f5f5f5; position: relative; top: -8px;">
            <span style="font-size: smaller; color: gray;">筛选查询</span>
        </div>
        <div style="height:50px">
        <el-row :gutter="20">
            <el-col :span="4"><el-input v-model="queryHome.name" placeholder="输入姓名"></el-input></el-col>
            <el-col :span="2"><el-button @click="selectPlayerInformation()">搜索</el-button></el-col>
            <el-col :span="6"><div class="grid-content bg-purple"></div></el-col>
            <el-col :span="6"><div class="grid-content bg-purple"></div></el-col>
        </el-row>  
        </div>
    </div>
    <!-- 全查 -->
    <div>
        <div style="height:30px ;width: 100%;background:#f5f5f5; position: relative; top: -8px;">
            <span style="font-size: smaller; color: gray;">用户列表</span>
        </div>
      <el-table :data="tableData" style="width: 100%" :header-cell-class-name="'headerBg'">
        <el-table-column prop="userName" label="用户微信名称" width="120" align="center">
        </el-table-column>
        <el-table-column prop="img" label="用户微信头像" width="125" align="center">
        <template slot-scope="scope">
        <el-image style="width: 100px; height: 100px" :src="scope.row.userAvatar">
        </el-image>
        </template>
        </el-table-column>
        <el-table-column prop="levelId" label="成语接龙玩家到达关数" width="100" align="center">
        </el-table-column>
        <el-table-column prop="adventureId" label="秘境探险剩余次数" width="100" align="center">
        </el-table-column>
        <el-table-column prop="adventureIdNumber" label="今日秘境通关次数" width="100" align="center">
        </el-table-column>
        <el-table-column prop="roleName" label="玩家当前角色等级名称" width="100" align="center">
        </el-table-column>
        <el-table-column prop="houseName" label="玩家当前房屋等级名称" width="100" align="center">
        </el-table-column>
        <el-table-column prop="currentPlayerExperience" label="玩家经验数量" width="100" align="center">
        </el-table-column>
        <el-table-column prop="currentPlayerGold" label="玩家金币数量" width="100" align="center">
        </el-table-column>
        <el-table-column prop="currentPlayerScore" label="玩家积分数量" width="100" align="center">
        </el-table-column>
        <el-table-column prop="loginTime" label="玩家最后一次登录时间" width="180" align="center">
        </el-table-column>
        <el-table-column prop="createTime" label="创建时间" width="180" align="center">
        </el-table-column>
        <el-table-column prop="updateTime" label="修改时间" width="180" align="center">
        </el-table-column>
      </el-table>
    </div>
    <!-- 分页 -->
<el-pagination :page-sizes="[5, 10, 15, 20]" :page-size="pages.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="pages.total" background :current-page.sync="pages.pageNum"
      @size-change="handleSizeChange" @current-change="handleCurrentChange"></el-pagination>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [],
      updatedisable:false,
      pages: {
        //分页参数
        total: 0, // 数据总条数
        pageNum: 1, // 当前页
        pageSize: 5, // 每页条数
      },
      updateData:{
        day:''
      },
      queryHome: {
        //分页参数
        name: "", // 数据总条数
      },
    };
  },
   mounted () {
    this.selectPlayerInformation()
  },
  methods: {

    selectPlayerInformation() {
      // 查询所需数据(全查)
      this.$axios
        .get("/playerInformation/selectPlayerInformation", {
          params: {
            name: this.queryHome.name,
            pageNum: this.pages.pageNum, // 当前页
            pageSize: this.pages.pageSize, // 每条页数
          },
        })
        .then((res) => {
          if (res.data.code=200) {
            //
            this.tableData = res.data.data.data.content;
            this.pages.total = res.data.data.data.totalSize;
            this.queryHome.frontDeskName = "";
            // this.getfrontDeskMember()
          }
          this.loading = false; // 加载圈绑定
        })
        .catch((err) => {
          // this.myMessage('error', err),
        });
    },
    // 分页插件方法
    handleSizeChange(val) {
      this.pages.pageSize = val;
      this.getfrontdeskuser();
    },
    handleCurrentChange(val) {
      this.pages.pageNum = val;
      this.getfrontdeskuser();
    },
    myMessage(type, message) {
      this.$message({
        message: message,
        type: type,
      });
    },
  }
};
</script>

<style>
.el-button:focus, .el-button:hover {
    color: #19CAAD;
    border-color: #19CAAD;
    background-color: #fafafa;
}
  .headerBg {
   background: #f8f8f9 !important;
}
</style>